﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xyz.BusinessObjects;
using Xyz.DataObjects.Interfaces;

namespace Xyz.DataObjects.Entity.Dao
{
    public class EntityServiceCategoryDao : IServiceCategoryDao
    {
        public List<ServiceCategory> GetServiceCategories()
        {
            using (var context = EntityObjectFactory.CreateContext())
            {
                var serviceCategories = new List<ServiceCategory>();
                var query = context.ServiceCategoryEntities.AsQueryable().ToList();

                query.ForEach(x => serviceCategories.Add(Mapper.Map(x)));

                return serviceCategories;
            }

        }
    }
}
